package xin.marcher.wind.consistency.config;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import xin.marcher.wind.consistency.custom.shard.ShardingKeyGenerator;

/**
 * 任务分库相关的配置
 *
 * @author marcher
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Configuration
@ConfigurationProperties(prefix = "wind.consistency.shard")
public class ShardModeConfigProperties {

    /**
     * 任务表是否进行分库
     */
    public Boolean taskSharded = false;

    /**
     * 生成任务表分片 key 的 ClassName 这里要配置类型全路径且类要实现 {@link ShardingKeyGenerator} 接口
     */
    private String shardingKeyGeneratorClassName = "";

}
